﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AsyncCamera.Camera.media;
using Incendios0_1.Camera.wpfdatamanager;
using AsyncCamera.Camera.Pelco;
using Incendios0_1.Camera.media.pipelines.cameras;
using Incendios0_1.Camera.media.sources;
using Incendios0_1.Camera.media.sinks;

namespace Incendios0_1.Camera.media.pipelines
{
    class RecordDisplay : MediaGroup
    {
        public RecordDisplay(AbstractCamera camera)
            : base()
        {
            MediaSource source = null;
            if (camera is PelcoCamera)
                source = new IPCameraSource(camera);
            else if (camera is FileCamera)
                source = new FileSource(camera);
            else if (camera is WebcamCamera)
                source = new WebCamSource(camera);
            source.AttachedCamera = camera;
            sources.AddLast(source);
            FileSink fsink = new FileSink(source);
            fsink.AttachedCamera = camera;
            sinks.AddLast(fsink);
            setDefaultOutput(source);
        }
    }
}
